import Page from '../../../../vue-common/models/Page';
import BaseModule from './base-module';
import Ajax from '../../lib/ajax';

class SelfModule extends BaseModule{
    state={
        member: {
            formItems: []
        },
        refunds: [],
        commodityEvaluationsPage: new Page('/api/services/app/OrderEvaluate/GetMemberEvaluates'),
        couponPage: new Page('/api/services/app/Coupon/GetAllMemberCoupon'),
        xpLogPage: new Page('/api/services/app/Member/GetAllXPLogs')
    }
    actions={
        async getSelf(context){
            var response = await Ajax.get('/api/services/app/Member/GetSelf');
            context.state.member = response.data.result;
        },
        async getRefunds(context){
            var response = await Ajax.get('/api/services/app/Order/GetAllRefunds');
            context.state.refunds = response.data.result;
        }
    };
    mutations={
    }
}

const selfModule = new SelfModule();
export default selfModule;